package com.controller;

import com.model.Echarts;
import com.model.Nums;
import com.model.User;
import com.model.yiqing;
import com.service.userService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("日志工作表")
@RestController
@RequestMapping("/table")
public class userController {

    @Autowired
    private userService userservice;

    @CrossOrigin
    @RequestMapping(value = "/getUser", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getUsers(@RequestBody yiqing user){
        System.out.println("查询现有确诊人数");
        List<Nums> value=userservice.getUser(user);
        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getWuzhengzhuang", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getWuzhengzhuang(@RequestBody yiqing user){
        System.out.println("查询无症状人数");
        List<Nums> value=userservice.getWuzhengzhuang(user);

        return value;
    }
    @CrossOrigin
    @RequestMapping(value = "/getXianyouyisi", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getXianyouyisi(@RequestBody yiqing user){
        System.out.println("查询现有疑似人数");
        List<Nums> value=userservice.getXianyouyisi(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getXianyouzhongzheng", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getXianyouzhongzheng(@RequestBody yiqing user){
        System.out.println("查询现有重症人数");
        List<Nums> value=userservice.getXianyouzhongzheng(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getLeijiquezhen", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getLeijiquezhen(@RequestBody yiqing user){
        System.out.println("查询累计确诊人数");
        List<Nums> value=userservice.getLeijiquezhen(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getJingwaishuru", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getJingwaishuru(@RequestBody yiqing user){
        System.out.println("查询境外输入人数");
        List<Nums> value=userservice.getJingwaishuru(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getLeijizhiyu", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getLeijizhiyu(@RequestBody yiqing user){
        System.out.println("查询累计治愈人数");
        List<Nums> value=userservice.getLeijizhiyu(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getLeijisiwang", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getLeijisiwang(@RequestBody yiqing user){
        System.out.println("查询累计死亡人数");
        List<Nums> value=userservice.getLeijisiwang(user);

        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getshuju", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getshuju(@RequestBody yiqing user){
        System.out.println("查询各省市数据");
        List<Nums> value=userservice.getshuju(user);
        return value;
    }

    @CrossOrigin
    @ApiOperation(value = "获取用户状态分析信息")
    @RequestMapping(value = "/getEcharts", produces = "application/json;charset=utf-8", method =  RequestMethod.PUT)
    public List<Echarts> getEcharts(@RequestBody yiqing user){
        System.out.println("进入用户分析方法");
        System.out.println(user.getNum());
        List<Echarts> Echarts=userservice.EchartsUserStart(user);

        return Echarts;
    }

    @CrossOrigin
    @ApiOperation(value = "获取用户状态分析信息")
    @RequestMapping(value = "/getEchartsall", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<Echarts> getEchartsall(@RequestBody yiqing user){
        System.out.println("进入用户分析方法");
        System.out.println(user.getNum());
        List<Echarts> Echarts=userservice.Echartsall(user);
        System.out.println(Echarts.size());
        return Echarts;
    }

    @CrossOrigin
    @ApiOperation(value = "获取用户状态分析信息")
    @RequestMapping(value = "/getEchartschina", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public List<Echarts> getEchartschina(@RequestBody yiqing user){
        System.out.println("进入用户分析方法");
        System.out.println(user.getNum());
        List<Echarts> Echarts=userservice.Echartschina(user);
        System.out.println(Echarts.size());
        return Echarts;
    }

    @CrossOrigin
    @RequestMapping(value = "/getXinzeng", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getXinzeng(@RequestBody yiqing user){
        System.out.println("查询国外新增确诊人数");
        List<Nums> value=userservice.getXinzeng(user);
        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getZhiyu", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getZhiyu(@RequestBody yiqing user){
        System.out.println("查询国外累计治愈人数");
        List<Nums> value=userservice.getZhiyu(user);
        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getSiwang", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getSiwang(@RequestBody yiqing user){
        System.out.println("查询国外累计死亡人数");
        List<Nums> value=userservice.getSiwang(user);
        return value;
    }

    @CrossOrigin
    @RequestMapping(value = "/getLeiji", produces = "application/json;charset=utf-8", method = RequestMethod.PUT)
    public  List<Nums> getLeiji(@RequestBody yiqing user){
        System.out.println("查询国外累计死亡人数");
        List<Nums> value=userservice.getLeiji(user);
        return value;
    }
}
